{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>编辑</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">姓名：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$info.user_username}" name="user_username" class="layui-input" lay-verify="required" >
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">性别：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_sex" value="1" title="男" {if $info.user_sex==1}checked{/if}>
                                <input type="radio" name="user_sex" value="2" title="女" {if $info.user_sex==2}checked{/if}>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">出生日期：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$info.user_birthday}" name="user_birthday" onclick="wk.lay_date2(this);" class="layui-input" lay-verify="required" readonly>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">手机号：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$info.user_phone}" name="user_phone" maxlength="11" class="layui-input" lay-verify="required" >
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">登录密码：</label>
                            <div class="layui-input-block">
                                <input type="password" placeholder="不改留空即可" name="user_password" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">个人职位：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$info.user_job_desc}" placeholder="最多10字" name="user_job_desc" maxlength="10" class="layui-input" lay-verify="required" >
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">团队角色：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_auth" value="1" title="业务员" {if $info.user_auth==1}checked{/if}>
                                <input type="radio" name="user_auth" value="2" title="区域负责人" {if $info.user_auth==2}checked{/if}>
                            </div>
                            <span style="color: red;">如果更改了角色，则会清空原先的负责区域，请及时设置新的负责区域</span>
                        </div>
                        <input type="hidden" value="{$info.user_id}" name="user_id">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                                </button>
                                <button class="layui-btn layui-btn-primary" onclick="wk.layer_close('close')">关闭</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
</body>
</html>
<script>
    layui.use(['form','upload','layedit'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('editTeamuser')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        layer.msg(res.msg,{icon:1,time:1500,shade:0.1},function(index){
                            wk.layer_close();
                        })
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            })
        });
    });
</script>